<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<!-- This code written by Willie Wheeler and John Wheeler -->
<!-- For 'Spring In Practice' [Book written by Willie Wheeler and John Wheeler] -->

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>Register</title>
		<style>
			.form-item { margin: 20px 0; }
			.form-label { font-weight: bold; }
		</style>
		<script type="text/javascript">
			window.onload = function() {
				document.getElementById("firstName").focus();
			}
		</script>
	</head>
	<body>
		<h1>Register</h1>
		
		<p>All fields are required.</p>
		
		<form:form modelAttribute="user">
			<div class="form-item">
				<div class="form-label">First name:</div>
				<form:input path="firstName" size="40"/>
			</div>
			<div class="form-item">
				<div class="form-label">Last name:</div>
				<form:input path="lastName" size="40"/>
			</div>
			<div class="form-item">
				<div class="form-label">E-mail address:</div>
				<form:input path="email" size="40"/> We won't spam you
			</div>
			<div class="form-item">
				<div class="form-label">User name:</div>
				<form:input path="username" size="40"/>
			</div>
			<div class="form-item">
				<div class="form-label">Password:</div>
				<form:password path="password" showPassword="true" size="40"/>
			</div>
			<div class="form-item">
				<div class="form-label">Confirm password:</div>
				<form:password path="passwordConfirmation" showPassword="true" size="40"/>
			</div>
			<div class="form-item">
				<form:checkbox path="marketingOk"/>
				Please send me product updates by e-mail.<br />
				(You can unsubscribe at any time.)
			</div>
			<div class="form-item">
				<form:checkbox path="acceptTerms"/>
				I accept the
				<a href="#" target="_blank"> terms of use</a>.
			</div>
			
			Please see our <a href="#" target="_blank">privacy policy</a>.

			<div class="form-item">
				<input type="submit" value="Register"/>
			</div>
		</form:form>	
	</body>
</html>
